package com.mqz.seckill.rabbitmq;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
@Slf4j
public class RabbitProducer {
    @Resource
    private RabbitTemplate rabbitTemplate;

    public void produce(String message) {
        rabbitTemplate.convertAndSend("seckillExchange", "seckill.message", message);
    }
}
